<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<!doctype html>
<html>

<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <title>首页</title>
    <meta name="description" content="这是一个 index 页面">
    <meta name="keywords" content="index">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <meta name="renderer" content="webkit">
    <meta http-equiv="Cache-Control" content="no-siteapp" />
    <link rel="icon" type="image/png" href="assets/i/favicon.png">
    <link rel="apple-touch-icon-precomposed" href="assets/i/app-icon72x72@2x.png">
    <meta name="apple-mobile-web-app-title" content="Amaze UI" />
    <link rel="stylesheet" href="../JS/assets/css/amazeui.min.css" />
    <link rel="stylesheet" href="..JS/assets/css/admin.css">
    <link rel="stylesheet" href="../JS/assets/css/app.css">
    <script src="../JS/assets/js/echarts.min.js"></script>
</head>

<body data-type="index">


    <header class="am-topbar am-topbar-inverse admin-header">
        <div class="am-topbar-brand">
            <a href="javascript:;" class="tpl-logo">
                <img src="../JS/assets/img/logo.png" alt="">
            </a>
        </div>
        <div class="am-icon-list tpl-header-nav-hover-ico am-fl am-margin-right">

        </div>

        <button class="am-topbar-btn am-topbar-toggle am-btn am-btn-sm am-btn-success am-show-sm-only" data-am-collapse="{target: '#topbar-collapse'}"><span class="am-sr-only">导航切换</span> <span class="am-icon-bars"></span></button>

        <div class="am-collapse am-topbar-collapse" id="topbar-collapse">

            <ul class="am-nav am-nav-pills am-topbar-nav am-topbar-right admin-header-list tpl-header-list">
                <li class="am-dropdown" data-am-dropdown data-am-dropdown-toggle>
                    <a class="am-dropdown-toggle tpl-header-list-link" href="javascript:;">
                        <span class="tpl-header-list-user-nick">${username}</span><span class="tpl-header-list-user-ico"> <img src="../JS/assets/img/user01.png"></span>
                    </a>
                    <ul class="am-dropdown-content">
                        <li><a href="#"><span class="am-icon-bell-o"></span> 资料</a></li>
                        <li><a href="#"><span class="am-icon-cog"></span> 设置</a></li>
                        <li><a href="#"><span class="am-icon-power-off"></span> 退出</a></li>
                    </ul>
                </li>
                <li><a href="###" class="tpl-header-list-link"><span class="am-icon-sign-out tpl-header-list-ico-out-size"></span></a></li>
            </ul>
        </div>
    </header>







    <div class="tpl-page-container tpl-page-header-fixed">


        <div class="tpl-left-nav tpl-left-nav-hover">
            <div class="tpl-left-nav-title">
                功能列表
            </div>
            <div class="tpl-left-nav-list">
                <ul class="tpl-left-nav-menu" style="display: block;">

                    <li class="tpl-left-nav-item">
                        <a href="javascript:;" class="nav-link tpl-left-nav-link-list">
                            <i class="am-icon-table"></i>
                            <span>信息查询</span>
                            <i class="am-icon-angle-right tpl-left-nav-more-ico am-fr am-margin-right"></i>
                        </a>
                        <ul class="tpl-left-nav-sub-menu ">
                            <li>
                            <form id="form-into-1" action="../SEL/phnumber.do"  method="post">
                            <input type="hidden" value="${csrf}" name="csrf">
                                <a href="javascript:;" onclick="getPages(1)">
                                    <i class="am-icon-angle-right"></i>
                                    <span>电话查询</span>
                                </a>
                                </form>
                            </li>
                             <li>
                            <form  id="form-into-2" action="../SEL/corpcode.do"  method="post">
                            <input type="hidden" value="${csrf}" name="csrf">
                                <a href="javascript:;" onclick="getPages(2)">
                                    <i class="am-icon-angle-right"></i>
                                    <span>集团编号查询</span>
                                </a>
                                </form>
                            </li>
                        </ul>

                    <li class="tpl-left-nav-item">
                        <a href="javascript:;" class="nav-link tpl-left-nav-link-list">
                            <i class="am-icon-wpforms"></i>
                            <span>个人设置</span>
                            <i class="am-icon-angle-right tpl-left-nav-more-ico am-fr am-margin-right tpl-left-nav-more-ico-rotate"></i>
                        </a>
                        <ul class="tpl-left-nav-sub-menu" >
                            <li>
                            <form id="form-into-3" action="../SEL/modifypwd.do"  method="post">
                            <input type="hidden" value="${csrf}" name="csrf">
                                <a href="javascript:;" onclick="getPages(3)">
                                    <i class="am-icon-angle-right"></i>
                                    <span>修改密码</span>
                                </a>
                                </form>
                            </li>
                        </ul>
                    </li>

                    <li class="tpl-left-nav-item">
                        <a href="login.html" class="nav-link tpl-left-nav-link-list">
                            <i class="am-icon-key"></i>
                            <span>登录</span>

                        </a>
                    </li>
                </ul>
            </div>
        </div>





        <div class="tpl-content-wrapper">
             <div class="tpl-portlet-components">
                <div class="portlet-title">
                    <div class="caption font-green bold">
                        <span class="am-icon-code"></span> 列表
                    </div>


                </div>
                <div class="tpl-block">
                    <div class="am-g">
                         <div class="am-u-sm-12 am-u-md-6"> 
                        </div> 
                        <div class="am-u-sm-12 am-u-md-3">
                            <div class="am-form-group">
                                <select  data-am-selected="{btnSize: 'sm'}" id="sel-option">
                                <c:forEach items="${upermission}" var="function" >
                                    <option value="${function.url}">${function.fname}</option>
                                </c:forEach>
                                </select>
                                
                            </div>
                        </div>
                        <div class="am-u-sm-12 am-u-md-3">
                            <div class="am-input-group am-input-group-sm">
                                <input type="text" class="am-form-field" id="value"  maxlength="11" minlength="2" >
                                <span class="am-input-group-btn">
                                    <button class="am-btn  am-btn-default am-btn-success tpl-am-btn-success am-icon-search" id="search" type="button" ></button>
                                </span>
                            </div>
                        </div>
                    </div>
                    <div class="am-g">
                        <div class="am-u-sm-12">
                            <form class="am-form">
                                <table class="am-table am-table-striped am-table-hover table-main">
                                    <thead id="table-thead">
                                    </thead>
                                    <tbody id="table-tbody">
                                    </tbody>
                                </table>
                                <div class="am-cf">

                                    <div class="am-fr">
                                        <ul class="am-pagination tpl-pagination">
                                            <li class="am-disabled"><a href="#">«</a></li>
                                            <li class="am-active"><a href="#">1</a></li>
                                            <li><a href="#">2</a></li>
                                            <li><a href="#">3</a></li>
                                            <li><a href="#">4</a></li>
                                            <li><a href="#">5</a></li>
                                            <li><a href="#">»</a></li>
                                        </ul>
                                    </div>
                                </div>
                                <hr>

                            </form>
                        </div>

                    </div>
                </div>
                <div class="tpl-alert"></div>
            </div>



                                        </div>
                                    </div>

    <script src="../JS/assets/js/jquery.min.js"></script>
    <script src="../JS/assets/js/amazeui.min.js"></script>
    <script src="../JS/assets/js/iscroll.js"></script>
    <script src="../JS/assets/js/app.js"></script>
    <script >
    	function getPages(param){
    		if(param==1){
    			$('#form-into-1').submit();
    		}else if(param==2){
    			$('#form-into-2').submit();
    		}else if(param==3){
    			$('#form-into-3').submit();
    		}
    	}
    
    	$("#search").click(function() {
			var op =  $("#sel-option option:selected").val();
			var value = $("#value").val();
			var headers = {};
			 headers['__RequestVerificationToken'] = '${csrf}';
			$.ajax({
				 type: "POST",
				 contentType: "application/x-www-form-urlencoded; charset=utf-8",
				 headers: headers,
				 cache: false,
				 data:{option:op,phNumber:value},
				 url: "../query/querybyphnum.do",
				 dataType:"json",
				 async: true,
				 error: function(data, error) {alert(",,,,")},
				 success: function(data){
					 $("tr").remove();
					switch (op) {
					case "corpinfo":
						 $("#table-thead").append("<tr><th>集团名称</th><th>集团ID</th><th>电话号码</th></tr>");
						 $("#table-tbody").append("<tr><td>"+data.corpname+"</td><td>"+data.corpid+"</td><td>"+data.phonenumber+"</td></tr>");
						break;
					case "userinfo":
						 $("#table-thead").append("<tr><th>集团名称</th><th>集团ID</th> </tr>");
						 $("#table-tbody").append("<tr><td>"+data.corpname+"</td><td>"+data.corpid+"</td> </tr>");
						break;
					case "failreglog":
						 $("#table-thead").append("<tr><th>集团名称</th><th>集团ID</th> </tr>");
						 $("#table-tbody").append("<tr><td>"+data.corpname+"</td><td>"+data.corpid+"</td> </tr>");
						break;
					case "monthfee":
						 $("#table-thead").append("<tr><th>集团名称</th><th>集团ID</th> </tr>");
						 $("#table-tbody").append("<tr><td>"+data.corpname+"</td><td>"+data.corpid+"</td> </tr>");
						break;
					case "personaldownreport":
						 $("#table-thead").append("<tr><th>集团名称</th><th>集团ID</th> </tr>");
						 $("#table-tbody").append("<tr><td>"+data.corpname+"</td><td>"+data.corpid+"</td> </tr>");
						break;
					case "personallib":
						 $("#table-thead").append("<tr><th>集团名称</th><th>集团ID</th> </tr>");
						 $("#table-tbody").append("<tr><td>"+data.corpname+"</td><td>"+data.corpid+"</td> </tr>");
						break;
					case "userlog":
						 $("#table-thead").append("<tr><th>集团名称</th><th>集团ID</th> </tr>");
						 $("#table-tbody").append("<tr><td>"+data.corpname+"</td><td>"+data.corpid+"</td> </tr>");
						break;
					default:
						break;
					}

				 }
			});
			
		});
    </script>
</body>

</html>